<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script src="../js/vue.js"></script>


		<!-- .stop 使用 -->
		<div id="app">
			<div @click="divClick">
				aaa
				<button @click.stop="btnClick">提交</button>
			</div>


			<!-- .prevent使用 -->
			<form action="baidu">

				<input type="submit" @click.prevent="formClick" />


				<!-- 监听某个键盘按键 -->

				<input type="text" @keyup.enter="key" />
			</form>
			
			
			<!-- .once语法使用 只提交一次-->
			<button @click.once="ll">提交</button>
		</div>


		<script>
			var app = new Vue({
				el: '#app',
				data: {

				},
				methods: {
					divClick() {
						console.log("divClick");
					},
					btnClick() {
						console.log("btnClick")
					},
					formClick() {
						console.log("formClick")
					},
					key() {
						console.log("key")
					},
					ll(){
						console.log("once")
					}
				}
			})
		</script>
	</body>
</html>
